package com.sxhuayuan.parking.plugin.partnerpay.result;

import com.sxhuayuan.parking.config.Platform;

/**
 * 车辆出场通知（申请扣款）返回
 * 
 * @author gy
 *
 */
public class PayApplyResult extends BaseResult {

	private Platform platform;
	/** 错误代码 */
	private String errcode;

	public PayApplyResult(Platform platform) {
		super();
		this.platform = platform;
	}

	public String getErrcode() {
		return errcode;
	}

	public void setErrcode(String errcode) {
		this.errcode = errcode;
	}

	public Platform getPlatform() {
		return platform;
	}

	public void setPlatform(Platform platform) {
		this.platform = platform;
	}

	/**
	 * 是否用户欠费
	 * 
	 * @return
	 */
	public boolean isUserOverdue() {
		switch (platform) {
		case weixin:
			return "REQUEST_BLOCKED".equals(errcode);
		case alipay:
			return false;
		default:
			return false;
		}
	}

	/**
	 * 是否用户解约或未绑定车牌
	 * 
	 * @return
	 */
	public boolean isUserBlocked() {
		switch (platform) {
		case weixin:
			return "VEHICLE_NOT_EXIST".equals(errcode);
		case alipay:
			return false;
		default:
			return false;
		}
	}
}